#ifndef _SUPER_ARC_H
#define _SUPER_ARC_H

#include "bettinumber.h"

namespace PBVP {
	/// A data structure representing an edge in augmented contour tree	
	class SuperArc
	{
	public:
		/// Default Constructor
		SuperArc();

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="_v1"></param>
		/// <param name="_v2"></param>
		/// <param name="_xe"></param>
		/// <param name="_be"></param>
		SuperArc(int _v1, int _v2, int _xe, int _be);

		/// <summary>
		/// Assignment Operator
		/// </summary>
		/// <param name="arc"></param>
		/// <returns>SuperArc&</returns>
		inline SuperArc& operator = (const SuperArc& arc);

		/// Destructor
		~SuperArc(void) {}

		int betti1() {
			return (1-xe) + ((be == 0)? 1:0);
		}

		int betti2() {
			return ((be == 0)? 1:0);
		}

		void calcBettiNumber() {
			//b2 = (be == 0)? 1:0;
			//b1 = 1 + b2 - xe;
		}

		BettiNumber getBettiNumbers();

		void addIntraNode(int nid) {
			intra_node = nid;
		}

		bool hasIntraNode() {
			return (intra_node >= 0);
		}

		int v1, v2;			// SuperNodes Id of the Arc
		int xe;				// Euler Characteristic
		int be;				// Number of boundary edges
		int id;				// unique super arc ID
		int intra_node;		// Internal critical point ID (if there is one);
	private:
		static int globalId;
	};

	SuperArc& SuperArc::operator =(const SuperArc& arc)
	{
		if(this == &arc) {
			return *this;
		}
		v1 = arc.v1;
		v2 = arc.v2;
		xe = arc.xe;
		be = arc.be;
		id = arc.id;
		intra_node = arc.intra_node;
		return *this;
	}
}
#endif


